home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / admin / linuxcon.000 / linuxcon / linuxconf-1.6 / uucp / internal.h < prev    next >
C/C++ Source or Header  |  1996-07-29  |  4KB  |  225 lines

  1. #pragma interface
  2. #ifndef INTERNAL_H
  3. #define INTERNAL_H
  4.  
  5. #ifndef MISC_H
  6.     #include "../misc/misc.h"
  7. #endif
  8. #ifndef DIALOG_H
  9.     #include "../dialog/dialog.h"
  10. #endif
  11.  
  12. class UUCP_HELP_FILE: public HELP_FILE{
  13.     /*~PROTOBEG~ UUCP_HELP_FILE */
  14. public:
  15.     UUCP_HELP_FILE (const char *fname);
  16.     /*~PROTOEND~ UUCP_HELP_FILE */
  17. };
  18.  
  19. class CONFIG_OBJ: public ARRAY_OBJ{
  20. public:
  21.     virtual void write (FILE *fout)=0;
  22.     /*~PROTOBEG~ CONFIG_OBJ */
  23.     /*~PROTOEND~ CONFIG_OBJ */
  24. };
  25.  
  26. class CONFIG_OBJS: public ARRAY{
  27. public:
  28.     SSTRING first_comment;
  29.     SSTRING last_comment;
  30.     CONFIG_FILE &f;
  31.     virtual CONFIG_OBJ *newobj (const char *, const SSTRING &, char *err)=0;
  32.     /*~PROTOBEG~ CONFIG_OBJS */
  33. public:
  34.     CONFIG_OBJS (CONFIG_FILE&_f);
  35. private:
  36.     CONFIG_OBJ *getitem (int no);
  37. public:
  38.     int read (void);
  39.     int write (void);
  40.     /*~PROTOEND~ CONFIG_OBJS */
  41. };
  42.  
  43. class POLL: public CONFIG_OBJ{
  44. public:
  45.     SSTRING comments;
  46.     SSTRING system;
  47.     SSTRING sched;
  48.     /*~PROTOBEG~ POLL */
  49. public:
  50.     POLL (const POLL *p);
  51.     POLL (const char *_system);
  52.     POLL (const char *buf,
  53.          const SSTRING&_comments,
  54.          char *err);
  55.     void write (FILE *fout);
  56.     /*~PROTOEND~ POLL */
  57. };
  58.  
  59. class POLLS: public CONFIG_OBJS{
  60.     /*~PROTOBEG~ POLLS */
  61. public:
  62.     POLLS (void);
  63.     POLL *getitem (const char *system);
  64.     POLL *getitem (int no);
  65. protected:
  66.     CONFIG_OBJ *newobj (const char *buf,
  67.          const SSTRING&_comments,
  68.          char *err);
  69. public:
  70.     /*~PROTOEND~ POLLS */
  71. };
  72.  
  73. class PERMISSION: public CONFIG_OBJ{
  74. public:
  75.     SSTRING comments;
  76.     SSTRING machine;
  77.     SSTRING myname;
  78.     SSTRING logname;
  79.     SSTRING dirread;
  80.     SSTRING dirwrite;
  81.     SSTRING commands;
  82.     char mayrequest;
  83.     char maysend;
  84.     /*~PROTOBEG~ PERMISSION */
  85. public:
  86.     PERMISSION (const PERMISSION *p);
  87.     PERMISSION (const char *buf,
  88.          const SSTRING&_comments,
  89.          char *err);
  90.     PERMISSION (void);
  91.     void write (FILE *fout);
  92.     /*~PROTOEND~ PERMISSION */
  93. };
  94.  
  95.  
  96. class PERMISSIONS: public CONFIG_OBJS{
  97.     /*~PROTOBEG~ PERMISSIONS */
  98. public:
  99.     PERMISSIONS (void);
  100.     PERMISSION *getitem (const char *machine);
  101.     PERMISSION *getitem (const char *machine,
  102.          int &no);
  103.     PERMISSION *getitem (int no);
  104. protected:
  105.     CONFIG_OBJ *newobj (const char *buf,
  106.          const SSTRING&_comments,
  107.          char *err);
  108. public:
  109.     /*~PROTOEND~ PERMISSIONS */
  110. };
  111.  
  112. struct CHAT_ELM{
  113.     SSTRING expected;
  114.     SSTRING send;
  115. };
  116.  
  117. // How many expect/send pairs in the dialog
  118. #define NBCHAT_ELM    6
  119.  
  120. class SYSTEM: public CONFIG_OBJ{
  121. public:
  122.     SSTRING name;
  123.     SSTRING when;    // When are we allowed to call
  124.     SSTRING phone;
  125.     CHAT_ELM tbchat[NBCHAT_ELM];
  126.     SSTRING acu;        // ACU or TCP
  127.     int speed;        // Modem speed
  128.     SSTRING comment;
  129.     /*~PROTOBEG~ SYSTEM */
  130. public:
  131.     SYSTEM (const char *line,
  132.          const SSTRING&_comment,
  133.          char *err);
  134.     SYSTEM (void);
  135.     int edit (PERMISSIONS&perms, POLLS&polls);
  136.     void write (FILE *fout);
  137.     /*~PROTOEND~ SYSTEM */
  138. };
  139.  
  140. class SYSTEMS: public CONFIG_OBJS{
  141.     /*~PROTOBEG~ SYSTEMS */
  142. public:
  143.     SYSTEMS (void);
  144.     int edit (PERMISSIONS&perms, POLLS&polls);
  145.     SYSTEM *getitem (int no);
  146. protected:
  147.     CONFIG_OBJ *newobj (const char *buf,
  148.          const SSTRING&_comments,
  149.          char *err);
  150. public:
  151.     void sort (void);
  152.     /*~PROTOEND~ SYSTEMS */
  153. };
  154.  
  155. class DIALERS;
  156.  
  157. class DEVICE: public CONFIG_OBJ{
  158. public:
  159.     SSTRING comments;
  160.     SSTRING acu;
  161.     SSTRING device;
  162.     SSTRING device2;    // Not sure what it is
  163.     int speed;
  164.     SSTRING type;        // Modem type from Dialer generally
  165.     SSTRING options;
  166.     /*~PROTOBEG~ DEVICE */
  167. public:
  168.     DEVICE (const char *buf,
  169.          const SSTRING&_comments,
  170.          char *err);
  171.     DEVICE (void);
  172.     int edit (const DIALERS&dial);
  173.     void write (FILE *fout);
  174.     /*~PROTOEND~ DEVICE */
  175. };
  176.  
  177. class DEVICES: public CONFIG_OBJS{
  178.     /*~PROTOBEG~ DEVICES */
  179. public:
  180.     DEVICES (void);
  181.     void edit (void);
  182.     DEVICE *getitem (int no);
  183. protected:
  184.     CONFIG_OBJ *newobj (const char *buf,
  185.          const SSTRING&_comments,
  186.          char *err);
  187. public:
  188.     void sort (void);
  189.     /*~PROTOEND~ DEVICES */
  190. };
  191.  
  192. class DIALER: public CONFIG_OBJ{
  193. public:
  194.     SSTRING comments;
  195.     SSTRING type;
  196.     SSTRING phonecnv;    // Special string for the phone number translation
  197.     SSTRING chat;        // Dialing chat
  198.     /*~PROTOBEG~ DIALER */
  199. public:
  200.     DIALER (const char *buf,
  201.          const SSTRING&_comments,
  202.          char *err);
  203.     DIALER (void);
  204.     void write (FILE *fout);
  205.     /*~PROTOEND~ DIALER */
  206. };
  207.  
  208. class DIALERS: public CONFIG_OBJS{
  209.     /*~PROTOBEG~ DIALERS */
  210. public:
  211.     DIALERS (void);
  212.     DIALER *getitem (const char *type)const;
  213.     DIALER *getitem (int no)const;
  214. protected:
  215.     CONFIG_OBJ *newobj (const char *buf,
  216.          const SSTRING&_comments,
  217.          char *err);
  218. public:
  219.     /*~PROTOEND~ DIALERS */
  220. };
  221.  
  222.  
  223. #endif
  224.  
  225.